<?php
  $count_category = 0;
?>

<?php if ($this->params->get('show_page_heading') && $this->params->get('page_heading')) {?>    
<div class="shophead<?php print $this->params->get('pageclass_sfx');?>">
  <h1 class="jshop-titleheading"><?php print $this->params->get('page_heading')?></h1>
</div>
<?php }?>

<div class="jshop">
<?php print $this->category->description?>

<div class="nts-list-category">
<?php if (count($this->categories)){?>
    <?php foreach($this->categories as $k=>$category) { $count_category +=1; ?>
        <?php if ($k%$this->count_category_to_row==0) print "<div class=\"nts-category-row clearfix\">"; ?>
        <div class="nts-category-wrap <?php if( ($count_category % $this->count_category_to_row) == 1) { echo "col-first"; } elseif( ($count_category % $this->count_category_to_row) == 0) { echo "col-last"; } ?>" style="width: <?php print (100/$this->count_category_to_row)?>%;">
          <div class="nts-category clearfix">
             <a class="nts-category-image" href="<?php print $category->category_link;?>"><img class="jshop_img" src = "<?php print $this->image_category_path;?>/<?php if ($category->category_image) print $category->category_image; else print $this->noimage;?>" alt="<?php print htmlspecialchars($category->name);?>" title="<?php print htmlspecialchars($category->name);?>" /></a>
             <h3 class="nts-category-name"><span><a class="product_link" href = "<?php print $category->category_link?>"><?php print $category->name?></a></span></h3>
             <div class="nts-category-short-desc"><?php print $category->short_description?></div>
           </div>
        </div>    
        <?php if ($k%$this->count_category_to_row==$this->count_category_to_row-1) print '</div>'; ?>
    <?php } ?>
        <?php if ($k%$this->count_category_to_row!=$this->count_category_to_row-1) print '</div>'; ?>    
<?php } ?>
</div>
</div>
